﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iLangl.Transport.Communication;

using System.Threading;
using iLangl.Model;

namespace iLangl.BusinessModel.Actions
{
	public class GetLanguages : BaseSecurityAction
	{
		
		public GetLanguages()
			: base()
		{
			LanguagesResponseContext context = new LanguagesResponseContext();
			ResponseContext = context;
			context.ContextUpdated += new EventHandler(context_ContextUpdated);
			isSynced = true;
			
		}

	
		void context_ContextUpdated(object sender, EventArgs e)
		{
			object result = ResponseContext.GetContext();

			if (result is List<Language>)
			{
				languages = (List<Language>)result;
			}

			weGetResult();
		}

		

		private List<Language> languages = null;
		public List<Language> Languages
		{
			get
			{
				return languages;
			}
		}
		

		protected override string GetName()
		{
			return "GetLanguages";
		}

		protected override string GetVersion()
		{
			return "1";
		}
	}
}
